public class SunR {
    public static int SumR(int a){

        return a < 10 ? a :a % 10 + SumR(a / 10);
    }

    public static void main(String[] args) {
        int ret = 1234;
        int a =SumR(ret);
        System.out.println(a);
    }
}
